<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/16 0016
 * Time: 下午 3:21
 */

namespace App\Http\Controllers\Admin;
use App\Http\Controllers\BaseController;
use Illuminate\Http\Request;
use App\Http\Classes\Log;

class LogController extends BaseController
{
    public function getLogs(Request $request){
        try{
            $data = $request -> all();
            $data = Log::getLogs($data);
            if($data === null){
                return$this->response(304,'获取失败！',null);
            }
            else{
                return $this->response(200,'获取成功！',$data);
            }
        }
        catch (\Exception $exception){
            Log::adminError(__FUNCTION__,$exception->getCode(),$exception->getMessage(),$exception->getFile(),$exception->getLine(), session('admin.admin_id') ? session('admin.admin_id') : 0);
            return $this->response(500,"系统内部错误！".$exception->getMessage(),null);
        }
    }
}